﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace NCAABasketballTournament
{
    public class Team
    {
        public string TeamName { get; set; }
        public int Seed { get; set; }
        public double Score 
        { 
            get {
                if ( m_oScore == 0.0)
                    m_oScore = ScoreFormula();
                return m_oScore;
            }
            set { m_oScore = value; }
        }

        public string Region { get; set; }
        public double TotalRebounds { get; set; }
        public double PersonalFouls { get; set; }
        public double RPI { get; set; }

        private double m_oScore = 0.0;

        private double ScoreFormula()
        {
            //Score = - 166 + 2.46 TotRbnd - 2.61 PF + 226 RPI - 1.34 Seed
            double dResult = -166.0 + 2.46 * TotalRebounds - 2.61 * PersonalFouls + 226.0 * RPI - 1.34 * (double)Seed;
            dResult = System.Math.Round(dResult, 2);
            return dResult;
            //old return -1.5 - 3.22 * (double)Seed + 2.19 * TotalRebounds - 2.88 * PersonalFouls;
 
        }
    }
}
